package com.github.boluo1230.wechat.entity.message;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class WxCustomAudio implements WxCustomMsg, Serializable {
    @JsonProperty(value = "touser")
    private String toUser;

    @JsonProperty(value = "msgtype")
    private String msgType = "voice";

    @JsonProperty(value = "voice")
    private Voice voice;

    public WxCustomAudio(String openId, String mediaId) {
        this.setToUser(openId);
        this.setVoice(new Voice(mediaId));
    }

    @Getter
    @Setter
    public class Voice {
        @JsonProperty(value = "media_id")
        private String mediaId;

        public Voice(String mediaId) {
            this.setMediaId(mediaId);
        }
    }
}
